<template>
  <div class="inventoryPlan">
    <el-card class="box-card">
      <div slot="header" class="clearfix">
        <span style="line-height: 36px;">盘点计划</span>
        <el-button style="float: right;" type="primary" @click="dialogOpen('add')" v-if="">新增</el-button>
      </div>
      <s-table
        :table="table"
        @http="tableWatch">
        <el-table-column
          fixed="right"
          align="center"
          slot="operation"
          class-name="operationMore"
          label="可用操作"
          width="260">
          <template slot-scope="s">
            <el-button type="success" style="margin: 5px" size="mini" @click="tablePreCheck(s.row)">预检</el-button>
            <el-button type="info"  size="mini" @click="dialogDetailedInventoryTotalOpen(s.row)" v-if="s.row.rwzt===1">库存盘点</el-button>
            <el-button type="info" style="margin: 5px" size="mini" @click="dialogIssuedOpen(s.row)" v-if="s.row.rwzt===1">盘点任务下发</el-button>
            <el-button type="info" size="mini" @click="dialogCreateBillOpen(s.row)" v-if="s.row.cyzt ===2">生成库存调整单</el-button>
            <el-button type="info" style="margin: 5px" size="mini" @click="tableCreate(s.row)" v-if="s.row.rwzt === 0 && s.row.zt === 0">生成盘点任务</el-button>
            <el-button type="info" size="mini" @click="tableCancel(s.row)" v-if="s.row.rwzt === 1 && s.row.zt ===0">取消盘点任务</el-button>
            <el-button type="danger" size="mini" @click="tableClose(s.row)">关闭盘点</el-button>
            <!--<el-tooltip placement="top">-->
              <!--<div slot="content">更多可用操作</div>-->
              <!--<el-popover-->
                <!--popper-class="demo-table-expand"-->
                <!--placement="right"-->
                <!--title="更多可用操作"-->
                <!--trigger="click">-->
                <!--<slot name="content">-->
                  <!--&lt;!&ndash;<el-button type="info" size="mini" @click="dialogDetailedOpen(s.row)" v-if="s.row.rwzt==='1'">盘点</el-button>&ndash;&gt;-->

                <!--</slot>-->
                <!--<el-button slot="reference" type="info" icon="more" :plain="true" size="mini" class="__reference"></el-button>-->
              <!--</el-popover>-->
            <!--</el-tooltip>-->
          </template>
        </el-table-column>
        <el-form-item slot="multiSelect" label="多选操作" prop="multiSelect" v-if="table.multiSelect">
          <el-row>
            <el-col :span="8">
              <el-button size="small" type="info" @click="dialogOperationOpen('')">作业人员</el-button>
            </el-col>
          </el-row>
        </el-form-item>
        <el-row>
          <el-col :xs="24" :lg="{span: 4, offset: 0}">
            <el-form-item label="盘点编号" prop="pdbh">
              <el-input type="text"
                        class="input"
                        v-model="autoVue_table_pdbh"
                        placeholder="盘点编号" spellcheck="false" auto-capitalize="off" auto-complete="off"
                        auto-correct="off"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 4, offset: 1}">
            <el-form-item label="盘点类型" prop="lx">
              <el-select v-model="autoVue_table_lx"
                         placeholder="盘点类型">
                <el-option
                  label="全部"
                  value=""></el-option>
                <el-option
                  v-for="item in INVENTORYPLAN.lx"
                  :key="item.dictionaryid"
                  :label="item.value"
                  :value="item.dictionaryid">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 4, offset: 1}">
            <el-form-item label="全仓盘点" prop="qcpd">
              <el-select v-model="autoVue_table_qcpd"
                         placeholder="全仓盘点">
                <el-option
                  label="全部"
                  value=""></el-option>
                <el-option
                  v-for="item in INVENTORYPLAN.qcpd"
                  :key="item.dictionaryid"
                  :label="item.value"
                  :value="item.dictionaryid">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 4, offset: 1}">
            <el-form-item label="任务状态" prop="rwzt">
              <el-select v-model="autoVue_table_rwzt"
                         placeholder="任务状态">
                <el-option
                  label="全部"
                  value=""></el-option>
                <el-option
                  v-for="item in INVENTORYPLAN.rwzt"
                  :key="item.dictionaryid"
                  :label="item.value"
                  :value="item.dictionaryid">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 4, offset: 1}">
            <el-form-item label="调整状态" prop="tzzt">
              <el-select v-model="autoVue_table_rwzt"
                         placeholder="调整状态">
                <el-option
                  label="全部"
                  value=""></el-option>
                <el-option
                  v-for="item in INVENTORYPLAN.tzzt"
                  :key="item.dictionaryid"
                  :label="item.value"
                  :value="item.dictionaryid">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :xs="24" :lg="{span: 4, offset: 0}">
            <el-form-item label="申请时间" prop="sqsj">
              <el-date-picker
                v-model="autoVue_table_sqsj"
                type="daterange"
                placeholder="选择日期范围">
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
      </s-table>
    </el-card>
    <s-dialog :dialog="dialog" :close="dialogInit">
      <p slot="title">{{dialog.title}}盘点</p>
      <el-tabs v-model="dialog.activeName">
        <el-tab-pane label="全仓盘点" name="1" disabled>
          <s-form :form="formDialog1" ref="formDialog1">
            <el-row>
              <el-col :xs="24" :lg="{span: 11, offset: 0}" class="">
                <el-form-item prop="pdbh" label="盘点编号">
                  <el-input
                    disabled
                    type="text"
                    v-model="formDialog1.pdbh"
                    placeholder="盘点编号"></el-input>
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 11, offset: 1}" class="">
                <el-form-item prop="lx" label="类型">
                  <el-select v-model="formDialog1.lx" placeholder="请选择">
                    <el-option
                      v-for="item in INVENTORYPLAN.lx"
                      :key="item.dictionaryid"
                      :label="item.value"
                      :value="item.dictionaryid">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :xs="24" :lg="{span: 11, offset: 0}" class="">
                <el-form-item prop="sqsj" label="申请时间">
                  <el-date-picker
                    type="datetime"
                    v-model="formDialog1.sqsj"
                    placeholder="申请时间">
                  </el-date-picker>
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 11, offset: 1}" class="">
                <el-form-item prop="qcpd" label="盘点方式">
                  <el-select v-model="formDialog1.qcpd" placeholder="请选择">
                    <el-option
                      label="全仓盘点"
                      value="0"></el-option>
                    <el-option
                      label="动碰盘点"
                      value="1"></el-option>
                    <el-option
                      label="随机盘点"
                      value="2"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :xs="24" :lg="{span: 11, offset: 0}" class="">
                <el-form-item prop="dtpd" label="动态盘点">
                  <div class="s-content">
                    <el-switch
                      v-model="formDialog1.dtpd"
                      on-color="#13ce66"
                      on-text="是"
                      off-text="否"
                      off-color="#ff4949"
                      on-value="1"
                      off-value="0">
                    </el-switch>
                  </div>
                  <!--<el-select v-model="formDialog1.dtpd" placeholder="请选择">-->
                    <!--<el-option-->
                      <!--v-for="item in INVENTORYPLAN.dtpd"-->
                      <!--:key="item.dictionaryid"-->
                      <!--:label="item.value"-->
                      <!--:value="item.dictionaryid">-->
                    <!--</el-option>-->
                  <!--</el-select>-->
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 11, offset: 1}" class="">
                <el-form-item prop="kkw" label="空库位">
                  <div class="s-content">
                    <el-switch
                      v-model="formDialog1.kkw"
                      on-color="#13ce66"
                      on-text="是"
                      off-text="否"
                      off-color="#ff4949"
                      on-value="1"
                      off-value="0">
                    </el-switch>
                  </div>
                  <!--<el-select v-model="formDialog1.kkw" placeholder="请选择">-->
                    <!--<el-option-->
                      <!--v-for="item in INVENTORYPLAN.kkw"-->
                      <!--:key="item.dictionaryid"-->
                      <!--:label="item.value"-->
                      <!--:value="item.dictionaryid">-->
                    <!--</el-option>-->
                  <!--</el-select>-->
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :xs="24" :lg="{span: 11, offset: 0}" class="">
                <el-form-item prop="bhgdkw" label="包含过渡库位">
                  <div class="s-content">
                    <el-switch
                      v-model="formDialog1.bhgdkw"
                      on-color="#13ce66"
                      on-text="是"
                      off-text="否"
                      off-color="#ff4949"
                      on-value="1"
                      off-value="0">
                    </el-switch>
                  </div>
                  <!--<el-select v-model="formDialog1.bhgdkw" placeholder="请选择">-->
                    <!--<el-option-->
                      <!--v-for="item in INVENTORYPLAN.bhgdkw"-->
                      <!--:key="item.dictionaryid"-->
                      <!--:label="item.value"-->
                      <!--:value="item.dictionaryid">-->
                    <!--</el-option>-->
                  <!--</el-select>-->
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 11, offset: 1}" class="">
                <el-form-item prop="mp" label="盲盘">
                  <div class="s-content">
                    <el-switch
                      v-model="formDialog1.mp"
                      on-color="#13ce66"
                      on-text="是"
                      off-text="否"
                      off-color="#ff4949"
                      on-value="1"
                      off-value="0">
                    </el-switch>
                  </div>
                  <!--<el-select v-model="formDialog1.mp" placeholder="请选择">-->
                    <!--<el-option-->
                      <!--v-for="item in INVENTORYPLAN.mp"-->
                      <!--:key="item.dictionaryid"-->
                      <!--:label="item.value"-->
                      <!--:value="item.dictionaryid">-->
                    <!--</el-option>-->
                  <!--</el-select>-->
                </el-form-item>
              </el-col>
            </el-row>
          </s-form>
        </el-tab-pane>
        <el-tab-pane label="动碰盘点" name="2" disabled v-if="formDialog1.qcpd === '1'">
          <s-form :form="formDialog2" ref="formDialog2">
            <el-row>
              <el-col :xs="24" :lg="{span: 11, offset: 0}" class="">
                <el-form-item prop="dpkssj" label="开始时间">
                  <el-date-picker
                    type="datetime"
                    v-model="formDialog2.dpkssj"
                    placeholder="开始时间">
                  </el-date-picker>
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 11, offset: 1}" class="">
                <el-form-item prop="dpjssj" label="结束时间">
                  <el-date-picker
                    is-range
                    type="datetime"
                    v-model="formDialog2.dpjssj"
                    placeholder="结束时间">
                  </el-date-picker>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :xs="24" :lg="{span: 11, offset: 0}" class="">
                <el-form-item prop="jqtj" label="精确条件">
                  <el-select v-model="formDialog2.jqtj" placeholder="请选择">
                    <el-option
                      label="产品"
                      value="0"></el-option>
                    <el-option
                      label="库位"
                      value="1"></el-option>
                    <el-option
                      label="库区"
                      value="2"></el-option>
                    <el-option
                      label="种类"
                      value="3"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 11, offset: 1}" class="" v-if="formDialog2.jqtj ==='0'">
                <el-form-item prop="cpid" label="产品">
                  <el-select v-model="formDialog2.cpid"
                             filterable
                             remote
                             @change="dialogRemoteCpmcid"
                             placeholder="请选择产品"
                             :remote-method="dialogRemoteCpmc">
                    <el-option
                      v-for="item in dialog.wmsgoods"
                      :key="item.id"
                      :label="item.mc"
                      :value="item.id">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 11, offset: 1}" class="" v-if="formDialog2.jqtj ==='1'">
                <el-form-item prop="kwid" label="库位名称" >
                  <el-select v-model="formDialog2.kwid"
                             filterable
                             remote
                             placeholder="请选择库位"
                             :remote-method="dialogRemoteKwmc">
                    <el-option
                      v-for="item in dialog.wmslibraryposition"
                      :key="item.id"
                      :label="item.mc"
                      :value="item.id">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 11, offset: 1}" class="" v-if="formDialog2.jqtj ==='2'">
                <el-form-item prop="kqid" label="库区名称">
                  <el-select v-model="formDialog2.kqid"
                             filterable
                             remote
                             placeholder="请输入库区名称"
                             :remote-method="dialogRemoteKqmc">
                    <el-option
                      v-for="item in dialog.wmslibraryposition1"
                      :key="item.dictionaryid"
                      :label="item.value"
                      :value="item.dictionaryid">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 11, offset: 1}" class="" v-if="formDialog2.jqtj ==='3'">
                <el-form-item prop="zlid" label="货品种类">
                  <el-select v-model="formDialog2.zlid"
                             filterable
                             remote
                             placeholder="请选择货品种类"
                             :remote-method="dialogRemoteHpmc">
                    <el-option
                      v-for="item in dialog.wmsgoodstype"
                      :key="item.id"
                      :label="item.mc"
                      :value="item.id">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
          </s-form>
        </el-tab-pane>
        <el-tab-pane label="随机盘点" name="3" disabled v-if="formDialog1.qcpd === '2'">
          <s-form :form="formDialog3" ref="formDialog3">
            <el-row>
              <el-col :xs="24" :lg="{span: 11, offset: 0}" class="">
                <el-form-item prop="kcs" label="库存数">
                  <el-input
                    type="text"
                    v-model="formDialog3.kcs"
                    placeholder="库存数"></el-input>
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 11, offset: 1}" class="">
                <el-form-item prop="jqtj" label="精确条件">
                  <el-select v-model="formDialog3.jqtj" placeholder="请选择">
                    <el-option
                      label="产品"
                      value="0"></el-option>
                    <el-option
                      label="库位"
                      value="1"></el-option>
                    <el-option
                      label="库区"
                      value="2"></el-option>
                    <el-option
                      label="种类"
                      value="3"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :xs="24" :lg="{span: 11, offset: 0}" class="" v-if="formDialog3.jqtj ==='0'">
                <el-form-item prop="cpid" label="产品">
                  <el-select v-model="formDialog3.cpid"
                             filterable
                             remote
                             @change="dialogRemoteCpmcid"
                             placeholder="请选择产品"
                             :remote-method="dialogRemoteCpmc">
                    <el-option
                      v-for="item in dialog.wmsgoods"
                      :key="item.id"
                      :label="item.mc"
                      :value="item.id">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 11, offset: 0}" class="" v-if="formDialog3.jqtj ==='1'">
                <el-form-item prop="kwid" label="库位名称">
                  <el-select v-model="formDialog3.kwid"
                             filterable
                             remote
                             placeholder="请选择库位"
                             :remote-method="dialogRemoteKwmc">
                    <el-option
                      v-for="item in dialog.wmslibraryposition"
                      :key="item.id"
                      :label="item.mc"
                      :value="item.id">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 11, offset: 0}" class="" v-if="formDialog3.jqtj ==='2'">
                <el-form-item prop="kqid" label="库区名称">
                  <el-select v-model="formDialog3.kqid"
                             filterable
                             remote
                             placeholder="请输入库区名称"
                             :remote-method="dialogRemoteKqmc">
                    <el-option
                      v-for="item in dialog.wmslibraryposition1"
                      :key="item.dictionaryid"
                      :label="item.value"
                      :value="item.dictionaryid">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 11, offset: 0}" class="" v-if="formDialog3.jqtj ==='3'">
                <el-form-item prop="zlid" label="货品种类">
                  <el-select v-model="formDialog3.zlid"
                             filterable
                             remote
                             placeholder="请选择货品种类"
                             :remote-method="dialogRemoteHpmc">
                    <el-option
                      v-for="item in dialog.wmsgoodstype"
                      :key="item.id"
                      :label="item.mc"
                      :value="item.id">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
          </s-form>
        </el-tab-pane>
      </el-tabs>
      <el-button slot="footer" v-if="dialog.activeName !== '1'" @click="dialogPre">上一页</el-button>
      <el-button slot="footer" v-if="formDialog1.qcpd!=='' && formDialog1.qcpd !=='0' && dialog.activeName === '1'" type="info" @click="dialogNext">下一页</el-button>
      <!--<el-button slot="footer" type="success"  @click="dialogSave" v-if="formDialog1.qcpd === '0' ? dialog.activeName === '2' : dialog.activeName === '3'">保存</el-button>-->
      <el-button slot="footer" type="success"  @click="dialogSave">保存</el-button>
    </s-dialog>
    <s-dialog :dialog="dialogPeople" :close="dialogPeopleInit">
      <p slot="title">{{dialogPeople.title}}</p>
      <s-form :form="formDialogPeople" ref="formDialogPeople">
        <el-row>
          <el-col :xs="24" :lg="{span: 11, offset: 0}" class="">
            <el-form-item prop="id" label="人员">
              <el-select v-model="formDialogPeople.id"
                         ref="formDialogPeople_zyryId"
                         filterable
                         placeholder="请输入人员名称">
                <el-option
                  v-for="item in dialogPeople.wmsqualityinspectionlist"
                  :key="item.id"
                  :label="item.name"
                  :value="item.id">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
      </s-form>
      <el-button slot="footer" @click="dialogPeopleSave">保存</el-button>
    </s-dialog>
    <s-dialog :dialog="dialogOperation" :close="dialogOperationInit">
      <p slot="title">生成操作人员</p>
      <s-form :form="formDialogOperation" ref="formDialogOperation">
        <el-row>
          <el-col :xs="24" :lg="{span: 11, offset: 0}" class="">
            <el-form-item prop="id" label="人员">
              <el-select v-model="formDialogOperation.id"
                         ref="formDialogPeople_zyryId"
                         filterable
                         placeholder="请输入人员名称">
                <el-option
                  v-for="item in dialogPeople.wmsqualityinspectionlist"
                  :key="item.id"
                  :label="item.name"
                  :value="item.id">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
      </s-form>
      <el-button slot="footer" @click="dialogOperationSave">保存</el-button>
    </s-dialog>
    <s-dialog :dialog="dialogIssued" :close="dialogIssuedInit">
      <p slot="title">{{dialogIssued.title}}盘点任务</p>
      <s-form :form="formDialogIssued" ref="formDialogIssued">
        <el-row>
          <el-col :xs="24" :lg="{span: 11, offset: 0}" class="">
            <el-form-item prop="account" label="账户类型">
              <el-select v-model="formDialogIssued.account" placeholder="请选择">
                <el-option
                  v-for="item in SHELVESTASK.account"
                  :key="item.dictionaryid"
                  :label="item.value"
                  :value="item.dictionaryid">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 11, offset: 1}" class="">
            <el-form-item prop="ryid" label="人员">
              <el-select v-model="formDialogIssued.ryid"
                         filterable
                         @change="dialogRemoteryid"
                         placeholder="请输入人员名称">
                <el-option
                  v-for="item in dialogIssued.wmsqualityinspectionlist"
                  :key="item.id"
                  :label="item.name"
                  :value="item.id">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
      </s-form>
      <el-button slot="footer" @click="dialogIssuedSave">保存</el-button>
    </s-dialog>
    <s-dialog :dialog="dialogDetailedInventoryTotal" :close="dialogDetailedInventoryTotalInit">
      <p slot="title">{{dialogDetailedInventoryTotal.title}}</p>
      <s-table :table="tableDetailedInventoryTotal" ref="tableDetailedInventoryTotal" @http="tableWatch" :expand="false">
        <el-table-column
          fixed="right"
          align="center"
          slot="operation"
          class-name="operationMore"
          label="可用操作"
          width="150">
          <template slot-scope="s">
            <el-button type="success" size="mini" @click="dialogDetailedOpen(s.row)">详细</el-button>
          </template>
        </el-table-column>
      </s-table>
      <el-button slot="footer" @click="dialogDetailedInventoryTotalSave">保存</el-button>
    </s-dialog>
    <s-dialog :dialog="dialogDetailed" :close="dialogDetailedInit">
      <p slot="title">{{dialogDetailed.title}}</p>
      <s-table :table="tableDetailed" ref="tableDetailed" @http="tableWatch">
        <el-table-column
          fixed="right"
          align="center"
          slot="operation"
          class-name="operationMore"
          label="可用操作"
          width="80">
          <template slot-scope="s">
            <el-button type="info" size="mini" @click="dialogPeopleOpen(s.row)">选择</el-button>
          </template>
        </el-table-column>
      </s-table>
      <el-button slot="footer" @click="dialogDetailedSave">保存</el-button>
    </s-dialog>
    <s-dialog :dialog="dialogCreateBill" :close="dialogCreateBillInit">
      <p slot="title">{{dialogCreateBill.title}}生成库存调整单</p>
      <s-table :table="tableCreateBill" :ref="tableCreateBill" @http="tableWatch">
        <el-table-column
          fixed="right"
          align="center"
          slot="operation"
          class-name="operationMore"
          label="可用操作"
          width="120">
          <template slot-scope="s">
            <el-button type="info" size="mini" @click="tableDetermine(s.row)">确定</el-button>
          </template>
        </el-table-column>
        <el-form-item slot="multiSelect" label="多选操作" prop="multiSelect" v-if="tableCreateBill.multiSelect">
          <el-row>
            <el-col :span="8">
              <el-button size="small" @click="tableDetermine">多选确定</el-button>
            </el-col>
          </el-row>
        </el-form-item>
      </s-table>
    </s-dialog>
  </div>
</template>

<script>
  import {AutoVue, AutoPromise} from '~/plugins/Tools';

  function __form () {
    return {
      pdbh: { value: '', rule: [ 'vNull' ], cRemarks: '' },
      lx: { value: '', rule: [ 'vNull__change' ], cRemarks: '' },
      sqsj: { value: '', rule: [ 'vNull' ], cRemarks: '' },
      qcpd: { value: '', rule: [ 'vNull' ], cRemarks: '' },
      dtpd: { value: '', rule: [ 'vNull__change' ], cRemarks: '' },
      kkw: { value: '0', rule: [ 'vNull__change' ], cRemarks: '' },
      bhgdkw: { value: '', rule: [ 'vNull__change' ], cRemarks: '' },
      mp: { value: '', rule: [ 'vNull__change' ], cRemarks: '' },
      cpid: { value: '', rule: [ 'vNull__change' ], cRemarks: '' },
      kwid: { value: '', rule: [ 'vNull__change' ], cRemarks: '' },
      kqid: { value: '', rule: [ 'vNull__change' ], cRemarks: '' },
      zlid: { value: '', rule: [ 'vNull__change' ], cRemarks: '' },
      kcs: { value: '', rule: [ 'vNull' ], cRemarks: '' },
      dpkssj: { value: '', rule: [ 'vNull' ], cRemarks: '' },
      dpjssj: { value: '', rule: [ 'vNull' ], cRemarks: '' },
      dppdzt: { value: '', rule: [ 'vNull__change' ], cRemarks: '' },
      sjpd: { value: '', rule: [ 'vNull__change' ], cRemarks: '' },
    };
  }
  function __form1 () {
    return {
      pdbh: { value: '', rule: [ 'vNull' ], cRemarks: '' },
      lx: { value: '', rule: [ 'vNull__change' ], cRemarks: '' },
      sqsj: { value: '', rule: [ 'vNull' ], cRemarks: '' },
      qcpd: { value: '', rule: [ 'vNull__change' ], cRemarks: '' },
      dtpd: { value: '', rule: [ 'vNull__change' ], cRemarks: '' },
      kkw: { value: '', rule: [ 'vNull__change' ], cRemarks: '' },
      bhgdkw: { value: '', rule: [ 'vNull__change' ], cRemarks: '' },
      mp: { value: '', rule: [ 'vNull__change' ], cRemarks: '' },
    };
  }
  function __form2 () {
    return {
      dpjssj: { value: '', rule: [ 'vNull__change' ], cRemarks: '' },
      dpkssj: { value: '', rule: [ 'vNull__change' ], cRemarks: '' },
      cpid: { value: '', rule: [ 'vNull__change' ], cRemarks: '' },
      kwid: { value: '', rule: [ 'vNull__change' ], cRemarks: '' },
      kqid: { value: '', rule: [ 'vNull__change' ], cRemarks: '' },
      zlid: { value: '', rule: [ 'vNull__change' ], cRemarks: '' },
      jqtj: { value: '', rule: [ 'vNull__change' ], cRemarks: '' },
    };
  }
  function __form3 () {
    return {
      cpid: { value: '', rule: [ 'vNull__change' ], cRemarks: '' },
      kwid: { value: '', rule: [ 'vNull__change' ], cRemarks: '' },
      kqid: { value: '', rule: [ 'vNull__change' ], cRemarks: '' },
      zlid: { value: '', rule: [ 'vNull__change' ], cRemarks: '' },
      sjpd: { value: '', rule: [ 'vNull__change' ], cRemarks: '' },
      kcs: { value: '', rule: [ 'vNull' ], cRemarks: '' },
      jqtj: { value: '', rule: [ 'vNull__change' ], cRemarks: '' },
    };
  }
  function __formPeople () {
    return {
      id: { value: '', rule: [ 'vNull__change' ] },
    };
  }
  function __formOperation () {
    return {
      id: { value: '', rule: [ 'vNull__change' ] },
    };
  }
  function __formIssued () {
    return {
      account: { value: '', rule: [ 'vNull__change' ] },
      ryid: { value: '', rule: [ 'vNull__change' ] },
    };
  }
  export default AutoVue({
    name: 'stock_inventoryPlan-FEcarWms',
    head: {
      'title': '盘点计划管理',
      'meta': [
        { 'hid': 'description', 'name': 'description', 'content': '乐速科技平台 盘点计划 查看盘点计划信息' },
      ],
    },
    store: ['DICTIONARY_inventoryPlan', 'INVENTORYPLAN', 'DICTIONARY_shelvesTask', 'SHELVESTASK'],
    data: {
      table: {
        column: [ { label: '盘点编号',
          prop: 'pdbh',
          minWidth: '0px',
          cRemarks: '',
          search: true },
        { label: '类型',
          prop: 'show_lx',
          minWidth: '0px',
          cRemarks: '',
          search: true },
        { label: '申请时间',
          prop: 'sqsj',
          minWidth: '0px',
          cRemarks: '',
          formatter: (row, column) => {
            return this.a.methods.formatterTime(row[column.property || column], 6);
          },
          search: true },
        { label: '全仓盘点',
          prop: 'show_qcpd',
          minWidth: '0px',
          cRemarks: '',
          search: true },
        { label: '动态盘点',
          prop: 'show_dtpd',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '空库位',
          prop: 'show_kkw',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '包含过渡库位',
          prop: 'show_bhgdkw',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '盲盘',
          prop: 'show_mp',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '动碰盘点',
          prop: 'show_dppdzt',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '动碰开始时间',
          prop: 'dpkssj',
          minWidth: '0px',
          cRemarks: '',
          formatter: (row, column) => {
            return this.a.methods.formatterTime(row[column.property || column], 6);
          },
          search: false },
        { label: '动碰结束时间',
          prop: 'dpjssj',
          minWidth: '0px',
          formatter: (row, column) => {
            return this.a.methods.formatterTime(row[column.property || column], 6);
          },
          cRemarks: '',
          search: false },
        { label: '随机盘点',
          prop: 'show_sjpd',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '库存数',
          prop: 'kcs',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '盘点任务状态',
          prop: 'show_rwzt',
          minWidth: '0px',
          cRemarks: '',
          search: true },
        { label: '调整状态',
          prop: 'show_tzzt',
          minWidth: '0px',
          cRemarks: '',
          search: true },
        { label: '盘点率',
          prop: 'pdl',
          minWidth: '0px',
          cRemarks: '',
          search: false } ],
        url: '/wmsinventoryplan/list',
        key: 'id',
        tableColumn: 4,
        muti: false,
        option: {
          planId: '',
        },
      },
      formDialog: __form(),
      formDialog1: __form1(),
      formDialog2: __form2(),
      formDialog3: __form3(),
      dialog: {
        title: '新增',
        row: {},
        wmsgoods: [],
        wmslibraryposition: [],
        wmsgoodstype: [],
        wmslibraryposition1: [],
        Cpmcid: '',
        activeName: '1',
      },

      tableDetailed: {
        column: [ { label: 'ASN编号',
          prop: 'asnbh',
          minWidth: '70px',
          cRemarks: '',
          search: false },
        { label: '货品编号',
          prop: 'goodsBh',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '货品名称',
          prop: 'goodsMc',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '货品批次',
          prop: 'hppc',
          minWidth: '70px',
          cRemarks: '',
          search: false },
        { label: '生产日期',
          prop: 'scrq',
          minWidth: '0px',
          cRemarks: '',
          formatter: (row, column) => {
            return this.a.methods.formatterTime(row[column.property || column], 3);
          },
          search: false },
        { label: '入库时间',
          prop: 'rksj',
          minWidth: '0px',
          cRemarks: '',
          formatter: (row, column) => {
            return this.a.methods.formatterTime(row[column.property || column], 3);
          },
          search: false },
        { label: '盘点数量',
          prop: 'pdsl',
          minWidth: '65px',
          cRemarks: '',
          elInputNumber: {
            min: 0,
            controls: [false, true],
            max: '',
          },
          search: false },
        { label: '作业人员',
          prop: 'zyryId',
          minWidth: '50px',
          cRemarks: '',
          search: false },
        { label: '失效日期',
          prop: 'sxrq',
          minWidth: '0px',
          cRemarks: '',
          formatter: (row, column) => {
            return this.a.methods.formatterTime(row[column.property || column], 6);
          },
          search: false },
        { label: 'lpn码',
          prop: 'lpn',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '供应商名称',
          prop: 'gysmc',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '库位名称',
          prop: 'kwmc',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '计划数量',
          prop: 'jhsl',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '差异状态',
          prop: 'show_cyzt',
          minWidth: '0px',
          cRemarks: '',
          search: false }],
        option: {
          planId: '',
        },
        url: '/wmsinventoryplan/getStockPlan',
        key: 'id',
        tableColumn: 8,
      },
      dialogDetailed: {
        title: '详细信息',
        size: 'large',
        row: '',
      },

      dialogPeople: {
        title: '选择',
        wmsqualityinspectionlist: '',
        row: {},
      },
      formDialogPeople: __formPeople(),

      dialogOperation: {
        title: '选择',
      },
      formDialogOperation: __formOperation(),

      dialogIssued: {
        title: '下发',
        wmsqualityinspectionlist: '',
        row: {},
        ryid: '',
      },
      formDialogIssued: __formIssued(),

      dialogDetailedInventoryTotal: {
        title: '合计信息',
        size: 'large',
      },
      tableDetailedInventoryTotal: {
        column: [
          { label: '货品编号',
            prop: 'hpbh',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '货品名称',
            prop: 'hpmc',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '库位名称',
            prop: 'kwmc',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '计划数量',
            prop: 'jhsl',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '盘点数量',
            prop: 'pdsl',
            minWidth: '0px',
            cRemarks: '',
            search: false },
        ],
        option: {
          pid: '',
        },
        url: '/wmsinventorymerge/list',
        tableColumn: 5,
        key: 'id',
      },
      dialogCreateBill: {
        title: '查看',
        size: 'large',
      },
      tableCreateBill: {
        column: [ { label: 'ASN编号',
          prop: 'asnbh',
          minWidth: '0px',
          cRemarks: '',
          search: true },
        { label: '货品编号',
          prop: 'goodsBh',
          minWidth: '0px',
          cRemarks: '',
          search: true },
        { label: '货品名称',
          prop: 'goodsMc',
          minWidth: '0px',
          cRemarks: '',
          search: true },
        { label: '货品批次',
          prop: 'hppc',
          minWidth: '0px',
          cRemarks: '',
          search: true },
        { label: '生产日期',
          prop: 'scrq',
          minWidth: '0px',
          cRemarks: '',
          formatter: (row, column) => {
            return this.a.methods.formatterTime(row[column.property || column], 6);
          },
          search: false },
        { label: '入库时间',
          prop: 'rksj',
          minWidth: '0px',
          cRemarks: '',
          formatter: (row, column) => {
            return this.a.methods.formatterTime(row[column.property || column], 6);
          },
          search: false },
        { label: '失效日期',
          prop: 'sxrq',
          minWidth: '0px',
          cRemarks: '',
          formatter: (row, column) => {
            return this.a.methods.formatterTime(row[column.property || column], 6);
          },
          search: false },
        { label: ' LPN码',
          prop: 'lpn',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '供应商',
          prop: 'gysmc',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '库位名称',
          prop: 'kwmc',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '计划数量',
          prop: 'jhsl',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '盘点人员',
          prop: 'zyryId',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '盘点数量',
          prop: 'pdsl',
          minWidth: '0px',
          cRemarks: '',
          search: false }],
        url: '/wmsinventoryplan/getStockCyRw',
        key: 'id',
        tableColumn: 10,
        option: {
          planId: '',
        },
      },
    },
    transition: 'slide-fade',
    methods: {
      tableDetermine (row) {
        this.$confirm('您将确定选择的盘点信息信息。', '确定操作？', {
          confirmButtonText: '是',
          cancelButtonText: '否',
          type: 'warning',
        })
          .then(async _ => {
            let ids = [];
            for (let item of this.table.multipleSelection) {
              ids.push(item.id);
            }
            try {
              await this.post('/wmsinventoryplan/tzPlanRw', {
                ids: ids.length === 0 ? [row.id] : ids,
              });
              this.tableWatch('tableCreateBill');
            } catch (err) {
              console.log(err);
            }
          })
          .catch(_ => {
          });
      },
      dialogCreateBillInit () {},
      async dialogCreateBillOpen (row) {
        try {
          this.tableCreateBill.url = '/wmsinventoryplan/getStockCyRw';
          this.tableCreateBill.option.planId = row.id;
          this.tableWatch('tableCreateBill');
          this.dialogCreateBill.visible = true;
        } catch (err) {
          console.log(err);
        };
      },
      dialogDetailedInventoryTotalInit () {},
      dialogIssuedInit () {
        this.formDialogIssued = {
          ...this.formDialogIssued,
          ...this.ObjectClone(__formIssued()),
        };
        this.resetFields('formDialogIssued');
      },
      async dialogIssuedOpen (row) {
        await AutoPromise([
          async () => {
            if (!this.DICTIONARY_shelvesTask) {
              await this.USE('DICTIONARY_shelvesTask');
            }
          },
        ]);
        this.dialogIssued.row = row;
        console.log('id:' + this.dialogIssued.row.id);
        this.dialogIssued.visible = true;
      },
      async dialogRemoteryid (id) {
        this.dialogIssued.wmsqualityinspectionlist.forEach(value => {
          if (id === value.id) {
            this.dialogIssued.row.userName = value.name;
          }
        });
      },
      dialogIssuedSave () {
        if (this.formDialogIssued.account === '0') {
          this.VALIDATE('formDialogIssued', async option => {
            delete option.account;
            option.zyryid = option.ryid;
            delete option.ryid;
            option.zyrymc = this.dialogIssued.row.userName;
            option.id = this.dialogIssued.row.id;
            try {
              await this.post('/wmsinventoryplan/issuePlanRw/', option);
              this.dialogIssuedInit();
              this.tableWatch('table');
              this.dialogIssued.visible = false;
            } catch (err) {
              console.log(err);
            }
          });
        } else {
          this.VALIDATE('formDialogIssued', async option => {
            delete option.account;
            option.zyryid = option.ryid;
            delete option.ryid;
            option.zyrymc = this.dialogIssued.row.userName;
            option.id = this.dialogIssued.row.id;
            try {
              await this.post('/wmsinventoryplan/issuePlanRw/', option);
              this.dialogIssuedInit();
              this.tableWatch('table');
              this.dialogIssued.visible = false;
            } catch (err) {
              console.log(err);
            }
          });
        }
      },
      /*
      tableCreateBill (row) {
        this.$confirm('您将选择的数据进行生成库存调整单的操作', '确认生成库存调整单？', {
          confirmButtonText: '是',
          cancelButtonText: '否',
          type: 'warning',
        })
          .then(async _ => {
            try {
              await this.get('/wmsinventoryplan/getStockCyRw/' + row.id);
              this.tableWatch('table');
            } catch (err) {
              console.log(err);
            }
          })
          .catch(_ => {
          });
      },
      */
      tablePreCheck (row) {
        this.$confirm('您将盘点预检选择的数据', '确认盘点预检？', {
          confirmButtonText: '是',
          cancelButtonText: '否',
          type: 'warning',
        })
          .then(async _ => {
            try {
              await this.get('/wmsinventoryplan/planWarning/' + row.id);
              this.tableWatch('table');
            } catch (err) {
              console.log(err);
            }
          })
          .catch(_ => {
          });
      },
      tableClose (row) {
        this.$confirm('您将关闭盘点选择的数据', '确认关闭盘点？', {
          confirmButtonText: '是',
          cancelButtonText: '否',
          type: 'warning',
        })
          .then(async _ => {
            try {
              await this.get('/wmsinventoryplan/closePlan/' + row.id);
              this.tableWatch('table');
            } catch (err) {
              console.log(err);
            }
          })
          .catch(_ => {
          });
      },
      tableIssued (row) {
        this.$confirm('您将选择的数据进行盘点任务下发', '确认盘点任务下发？', {
          confirmButtonText: '是',
          cancelButtonText: '否',
          type: 'warning',
        })
          .then(async _ => {
            try {
              await this.post('/wmsinventoryplan/issuePlanRw/' + row.id);
              this.tableWatch('table');
            } catch (err) {
              console.log(err);
            }
          })
          .catch(_ => {
          });
      },
      tableCreate (row) {
        this.$confirm('您将选择的数据进行生成盘点任务的操作', '确认生成盘点任务？', {
          confirmButtonText: '是',
          cancelButtonText: '否',
          type: 'warning',
        })
          .then(async _ => {
            try {
              await this.get('/wmsinventoryplan/addPlanRw/' + row.id);
              this.tableWatch('table');
            } catch (err) {
              console.log(err);
            }
          })
          .catch(_ => {
          });
      },
      tableCancel (row) {
        this.$confirm('您将选择的数据进行取消盘点任务的操作', '确认取消盘点任务？', {
          confirmButtonText: '是',
          cancelButtonText: '否',
          type: 'warning',
        })
          .then(async _ => {
            try {
              await this.get('/wmsinventoryplan/closePlanRw/' + row.id);
              this.tableWatch('table');
            } catch (err) {
              console.log(err);
            }
          })
          .catch(_ => {
          });
      },
      dialogInit () {
        this.dialog.activeName = '1';
        this.dialog.row = {};
        this.formDialog1 = {
          ...this.formDialog1,
          ...this.ObjectClone(__form1()),
        };
        this.formDialog2 = {
          ...this.formDialog2,
          ...this.ObjectClone(__form2()),
        };
        this.formDialog3 = {
          ...this.formDialog3,
          ...this.ObjectClone(__form3()),
        };
        this.resetFields('formDialog1');
        this.resetFields('formDialog2');
        this.resetFields('formDialog3');
      },
      async dialogOpen (type, row) {
        await AutoPromise([
          async () => {
            if (!this.DICTIONARY_inventoryPlan) {
              await this.USE('DICTIONARY_inventoryPlan');
            }
          },
          async () => {
            await this.dialogRemoteCpmc('');
          },
          async () => {
            await this.dialogRemoteKwmc('');
          },
          async () => {
            await this.dialogRemoteHpmc('');
          },
          async () => {
            await this.dialogRemoteKqmc('');
          },
          async () => {
            let bh = await this.get('/wmsinventoryplan/getPdBh');
            this.formDialog1.pdbh = bh;
          },
        ]);
        if (type) {
          type = type.toUpperCase();
        } else return;
        switch (type) {
        case 'ADD':
          this.dialog.title = '新增';
          this.formDialog.id = 0;
          break;
        case 'PUT':
          this.dialog.title = '修改';
          this.formDialog = {
            ...this.formDialog,
            ...this.ObjectClone(__form(), row),
          };
          this.dialog.row = row;
          break;
        }
        this.dialog.visible = true;
      },
      async dialogRemoteCpmc (query) {
        let {contentList} = await this.post('/wmsgoods/getGoodsBySshzid', {mc: query});
        this.dialog.wmsgoods = contentList;
      },
      async dialogRemoteCpmcid (id) {
        this.dialog.wmsgoods.forEach(value => {
          if (value.id === id) {
            this.dialog.Cpmc = value.mc;
          }
        });
      },
      async dialogRemoteKwmc (query) {
        let {contentList} = await this.post('/wmslibraryposition/getLibrarysBymc', {mc: query});
        this.dialog.wmslibraryposition = contentList;
      },
      async dialogRemoteHpmc (query) {
        this.dialog.wmsgoodstype = await this.post('/wmsgoodstype/getWmsGoodsTypeByHzId', {mc: query});
      },
      async dialogRemoteKqmc (query) {
        this.dialog.wmslibraryposition1 = await this.post('/wmslibraryposition/addSearchArea', {mc: query});
      },
      dialogPre () {
        if (this.formDialog1.qcpd === '1') {
          this.dialog.activeName = parseInt(this.dialog.activeName) - 1 + '';
        } else {
          this.dialog.activeName = parseInt(this.dialog.activeName) - 2 + '';
        }
      },
      dialogNext () {
        if (this.formDialog1.qcpd === '1') {
          this.VALIDATE('formDialog' + this.dialog.activeName, option => {
            this.dialog.activeName = parseInt(this.dialog.activeName) + 1 + '';
          });
        } else {
          this.VALIDATE('formDialog' + this.dialog.activeName, option => {
            console.log('pcpd:' + option.pcpd);
            this.dialog.activeName = parseInt(this.dialog.activeName) + 2 + '';
          });
        }
      },
      dialogSave () {
        this.VALIDATE('formDialog1', async option => {
          if (this.formDialog1.qcpd === '0') {
            option.sqsj = this.formDialog1.sqsj.getTime();
            option.qcpd = this.formDialog1.qcpd;
            option.qcpd = '1';
            try {
              await this.post('/wmsinventoryplan/add', option);
              this.tableWatch('table');
              this.dialogInit();
              this.dialog.visible = false;
            } catch (err) {
              console.log(err);
            }
          } else if (this.formDialog1.qcpd === '1') {
            let json = {
              ...this.FORMOPTION('formDialog1'),
              ...this.FORMOPTION('formDialog2'),
            };
            json.sqsj = this.formDialog1.sqsj.getTime();
            json.dpkssj = this.formDialog2.dpkssj.getTime();
            json.dpjssj = this.formDialog2.dpjssj.getTime();
            json.qcpd = this.formDialog1.qcpd;
            json.qcpd = '0';
            json.dppdzt = 1;
            try {
              await this.post('/wmsinventoryplan/add', json);
              this.dialogInit();
              this.tableWatch('table');
              this.dialog.visible = false;
            } catch (err) {
              console.log(err);
            }
          } else {
            let json = {
              ...this.FORMOPTION('formDialog1'),
              ...this.FORMOPTION('formDialog3'),
            };
            json.sqsj = this.formDialog1.sqsj.getTime();
            json.qcpd = this.formDialog1.qcpd;
            json.qcpd = '0';
            json.sjpd = '1';
            json.dppdzt = '0';
            console.log('111:' + 111);
            try {
              await this.post('/wmsinventoryplan/add', json);
              this.dialogInit();
              this.tableWatch('table');
              this.dialog.visible = false;
            } catch (err) {
              console.log(err);
            }
          }
        });
      },

      dialogDetailedInit () {},
      dialogDetailedOpen (row) {
        this.tableDetailed.option.pdhbid = row.id;
        this.tableDetailed.url = 'wmsinventoryplan/getStockPlan';
        this.tableWatch('tableDetailed');
        this.dialogDetailed.visible = true;
      },
      async dialogDetailedSave () {
        try {
          await this.post('/wmsinventoryplan/addStockPlan', this.tableDetailed.data);
          this.tableDetailedInventoryTotal.url = '/wmsinventorymerge/list';
          this.tableWatch('tableDetailedInventoryTotal');
          this.dialogDetailedInit();
          this.dialogDetailed.visible = false;
        } catch (err) {
          console.log(err);
        }
      },

      dialogPeopleInit () {
        this.formDialogPeople = {
          ...this.formDialogPeople,
          ...this.ObjectClone(__formPeople()),
        };
        this.resetFields('formDialogPeople');
      },
      async dialogPeopleOpen (row) {
        await AutoPromise([
          async () => {
            if (this.dialogPeople.wmsqualityinspectionlist.length === 0) {
              this.dialogPeople.wmsqualityinspectionlist = await this.post('/wmsqualityinspectionlist/selectYh', {
              });
            }
          },
        ]);
        this.dialogPeople.row = row;
        this.dialogPeople.visible = true;
      },
      dialogPeopleSave () {
        this.VALIDATE('formDialogPeople', async option => {
          this.dialogPeople.row.zyryId = this.$refs.formDialogPeople_zyryId.selectedLabel;
          this.dialogPeopleInit();
          this.dialogPeople.visible = false;
        });
      },

      dialogOperationInit () {},
      dialogOperationOpen (table) {
        this.dialogOperation.visible = true;
      },
      dialogOperationSave () {},

      dialogDetailedInventoryTotalOpen (row) {
        this.tableDetailedInventoryTotal.url = '/wmsinventorymerge/list';
        this.tableDetailedInventoryTotal.option.pid = row.id;
        this.tableWatch('tableDetailedInventoryTotal');
        this.dialogDetailedInventoryTotal.visible = true;
      },
      dialogDetailedInventoryTotalSave () {
        this.dialogDetailedInventoryTotal.visible = false;
      },
    },
    watch: {
      'formDialogIssued.account': async function (account) {
        this.formDialogIssued.ryid = '';
        if (account.length !== 0 && account === '0') {
          this.dialogIssued.wmsqualityinspectionlist = await this.post('/wmsqualityinspectionlist/selectYh', {});
        }
        if (account.length !== 0 && account === '1') {
          let {contentList} = await this.post('/wmsqualityinspectionlist/selectPDADLByHz', {
          });
          this.dialogIssued.wmsqualityinspectionlist = contentList;
        }
      },
    },
    mounted: async function () {
      this.tableWatch('table');
      if (!this.DICTIONARY_inventoryPlan) {
        await this.USE('DICTIONARY_inventoryPlan');
      }
    },
  });
</script>
<style scoped lang="scss">
  .box-card {
    margin: 20px;
  }

  .createTimeSpan {
    display: block;
    margin-top: 34px;
  }

  @media screen and (max-width: 800px) {
    .createTimeSpan {
      margin-top: 0;
    }
    .box-card {
      margin: 0;
    }
  }

  .el-select {
    width: 100%;
  }
</style>

<style lang="scss">
  .inventoryPlan{
    width: 88vw;
    float: left;
  }
</style>
